import ObservableObject from "../observer/observable.object"
import * as THREE from "three"
import measurementEnum from "../enum/measurement.enum"
export default class Measurement extends ObservableObject {
  type: number
  sid: string
  visible: boolean
  version: string
  created: Date
  modified: Date
  start_position: THREE.Vector3
  end_position: THREE.Vector3
  text: string
  group: number
  groupOrder: number
  floorId: string
  roomId: string
  static RAYCASTER_GROUP: string
  constructor() {
    super()
    this.type = measurementEnum.FloorplanOnly
    this.sid = ""
    this.visible = !1
    this.version = "3.2"
    this.created = new Date()
    this.modified = new Date()
    this.start_position = new THREE.Vector3()
    this.end_position = new THREE.Vector3()
    this.text = ""
    this.group = -1
    this.groupOrder = -1
  }
  copy(e) {
    this.type = e.type
    this.sid = e.sid
    this.text = e.text
    this.visible = e.visible
    this.created = e.created
    this.modified = e.modified
    this.floorId = e.floorId
    this.start_position.copy(e.start_position)
    this.end_position.copy(e.end_position)
    this.group = e.group
    this.groupOrder = e.groupOrder
    this.roomId = e.roomId
    this.commit()
    return this
  }
}
Measurement.RAYCASTER_GROUP = "measurements"
